/*
 * @Author: Jimmy
 * @LastModifiedBy: Jimmy
 * @Date: 2024-07-06 20:57:49
 * @LastEditTime: 2024-09-07 20:44:34
 * @FilePath: /nest_study/server/src/modules/monitor/online/online.controller.ts
 */
import { Controller, Get, Post, Body, Delete, Query } from '@nestjs/common';
import { OnlineService } from './online.service';
import { ApiBearerAuth, ApiBody, ApiOperation, ApiTags } from '@nestjs/swagger';
import { OnlineListDto } from './dto/index.dto';

@ApiTags('系统监控-在线用户')
@ApiBearerAuth()
@Controller('monitor/online')
export class OnlineController {
  constructor(private readonly onlineService: OnlineService) { }

  @ApiOperation({
    summary: '在线用户列表'
  })
  @ApiBody({
    type: OnlineListDto,
    required: true
  })
  @Get('/list')
  queryList(@Query() query: OnlineListDto) {
    return this.onlineService.findAll(query);
  }

  @ApiOperation({
    summary: '在线用户-强退',
  })
  @Delete('/')
  remove(@Body() info: {token:string,id:number}) {
    return this.onlineService.remove(info);
  }
}
